package com.liuwei.msmall.common.enums;

import lombok.Getter;

/**
 * @author llww
 * @date 2021/2/25 14:54
 */
public enum ErrorCode {

    /**
     * 错误码
     */
    OK(0, "success"),
    BAD_REQUEST(10400, "请求参数错误或不完整"),
    UNAUTHORIZED(10401, "请先进行认证"),
    FORBIDDEN(10403, "无权查看"),
    NOT_FOUND(10404, "未找到该路径"),
    METHOD_NOT_ALLOWED(10405, "请求方式不支持"),
    CONFLICT(10409, "请求资源状态冲突"),
    TIMEOUT(10499, "请求超时"),
    INTERNAL_SERVER_ERROR(10500, "{}"),
    SERVICE_UNAVAILABLE(10503, "服务不可用"),
    SYSTEM_ERROR(10000,"系统异常");

    @Getter
    private int code;
    @Getter
    private String msg;

    ErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
